#pragma once
#ifndef _QUATERNION_H__
#define _QUATERNION_H__

#include"Vector3.h"

class Quaternion : public D3DXQUATERNION
{
public:
	void Normalize() { D3DXQuaternionNormalize(this, this); }
	void Slerp(const Quaternion &begin, const Quaternion &end, float coeff) { D3DXQuaternionSlerp(this, &begin, &end, coeff); }
	void GetAxisAngle(Vector3 &axis, float &angle) const { D3DXQuaternionToAxisAngle(this, &axis, &angle); }
	
	void CreateFromYawPitchRoll(const float yaw, const float pitch, const float roll) { D3DXQuaternionRotationYawPitchRoll(this, yaw, pitch, roll); }
	void CreateFromAxisAngle(const Vector3 &axis, const float radians) { D3DXQuaternionRotationAxis(this, &axis, radians); }

	Quaternion(D3DXQUATERNION &q) : D3DXQUATERNION(q) { }
	Quaternion() : D3DXQUATERNION() { }

	static Quaternion Identity;
};

#endif